<%@ page import="com.gpay.erp.core.system.bean.SysUser" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<script src="<%=request.getContextPath() %>/resources/js/purchase/paymentManage.js"
        type="text/javascript"></script>
<script src="<%=request.getContextPath() %>/resources/js/purchase/paymentApS.js"
        type="text/javascript"></script>
<%--<script src="<%=request.getContextPath() %>/resources/js/purchase/paymentApAdd.js"--%>
        <%--type="text/javascript"></script>--%>
<script src="<%=request.getContextPath() %>/resources/js/purchase/paymentApView.js"
        type="text/javascript"></script>
<script>
  var selectedRows;
  $(function () {
    var paymentApId = $("#paymentApId").text();
    if (paymentApId) {
      $('#memberNoDiv').html("<label>供应商代码:</label><input id='memberNo' name='f_providerId' data-options='required:true' readonly style='width:90px' />");
      $('#shifujine').show();
      initSelect($('#payMethod'), payMethodArray);

      $("#verifyPaymentAp").click(function () {
        changeStatus("/payment/saveChangeStatusApplicationSub.html", paymentApId, "passApp", refreshPaymentApOnlyViewPage);
      });
      $("#notVerifyPaymentAp").click(function () {
        changeStatus("/payment/saveChangeStatusApplicationSub.html", paymentApId, "passnotApp", refreshPaymentApOnlyViewPage);
      });
      $("#cancelVerifyPaymentAp").click(function () {
        changeStatus("/payment/saveChangeStatusApplicationSub.html", paymentApId, "cancelCheck", refreshPaymentApOnlyViewPage);
      });

      //获取子项列表
      $.ajax({
        type: "post",
        data: {'id': paymentApId},
        dataType: "json",
        url: getContextPath() + "/payment/selectPaidApplicationSub.html",
        before: function () {
          parent.$.messager.progress({
            title: '提示',
            text: '数据处理中，请稍后....'
          });
        },
        success: function (data) {
          parent.$.messager.progress('close');
          if (data && isSuccess(data.result)) {
            refreshPaymentApOnlyViewPage(data);
          } else {
            commonError(data.result, data.message);
          }
        },
        timeout: 1000,
        error: function (result) {
//			internalError();
          templateInternalError(result.responseText);
          parent.$.messager.progress('close');
        }
      });

    }
  });

</script>
<%--申请单号、申请状态、供应商代码、供应商名称、申请金额、支付方式、申请日期、申请人、备注--%>
<var hidden="hidden" id="paymentApId">${paymentApId}</var>
<div class="easyui-layout" data-options="fit : true,border : false">
  <div data-options="region:'north',title:'付款申请',border : false" style="height: 140px; overflow: hidden;">
    <form id="searchForm-small">
      <div class="mLeft60">
        <div class="mTop10 line-handsome">
          <div class="fLeft label-handsome ">
            <label>申请单号:</label>
            <input id="paidAppNumber" name="paidAppNumber" readonly>
            </input>
          </div>
          <div class="fLeft label-handsome ">
            <label>申请状态:</label>
            <input id="paidStatus" name="paidStatus" class="easyui-input" readonly/>
          </div>
          <div class="fLeft label-handsome" id="memberNoDiv">
            <label class="redSharp">* 供应商代码:</label>
            <select id="memberNo" name="f_providerId" data-options="required:true" style="width:90px" readonly>
            </select>
          </div>
          <div class="fLeft label-handsome ">
            <label>供应商名称:</label>
            <input id="providerName" name="providerName" class="easyui-input" readonly/>
          </div>
        </div>
        <div class="mTop10 line-handsome">
          <div class="fLeft label-handsome ">
            <label>申请金额:</label>
            <input id="appAmount" name="appAmount" readonly>
            </input>
          </div>
          <div class="fLeft label-handsome " id="shifujine" hidden="hidden">
            <label>实付金额:</label>
            <input id="realAmount" name="realAmount" readonly>
            </input>
          </div>
          <div class="fLeft label-handsome" id="userNameDiv">
            <label>支付方式:</label>
            <select id="payMethod" name="payMethod" style="width:90px" readonly>
            </select>
          </div>
          <div class="fLeft label-handsome ">
            <label>申请日期:</label>
            <input id="paidStarttime" type="text" name="paidStarttime" class="easyui-datebox"
                   required="required" readonly style="width:90px"/>
          </div>
          <div class="fLeft label-handsome ">
            <label>申请人:</label>
            <input id="operater" name="operater" class="easyui-input" readonly
                   value="<%=((SysUser)session.getAttribute("loginUser")).getUserName()%>"/>
          </div>

        </div>
        <div class="mTop10 line-handsome">
          <div class="fLeft label-handsome ">
            <label>备注:</label>
            <input id="remark" name="remark" class="easyui-input" readonly/>
          </div>
        </div>
      </div>
    </form>
  </div>
  <div data-options="region:'center',border : false,title:'付款申请子项列表'">
    <table id="subItem"></table>
  </div>
</div>